# coding: utf8
validarMod = auth.relacionUsuaplug(xmlc_divipola['plug_nombre'])

#@auth.requires(validarMod)

def index():
    return dict(rows=db().select(db.sgd_cont_continente.ALL, db.sgd_pais.ALL, db.sgd_depa_departamento.ALL, db.sgd_muni_municipio.ALL,\
    left=[db.sgd_pais.on(db.sgd_pais.sgd_cont_continente==db.sgd_cont_continente.id), 
    db.sgd_depa_departamento.on(db.sgd_depa_departamento.sgd_pais==db.sgd_pais.id),
    db.sgd_muni_municipio.on(db.sgd_muni_municipio.sgd_depa_departamento==db.sgd_depa_departamento.id)]))
    

def edipola():
    table=db[request.args(0)]
    form = crud.update(table,request.args(1))
    return dict(form=form)
